/*
 * @Author: user05 user05@123.com
 * @Date: 2025-03-14 15:52:57
 * @LastEditors: user05 user05@123.com
 * @LastEditTime: 2025-04-02 10:05:16
 * @FilePath: \pfsense-boss\src\api\business\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/config/axios'
export  const getDashboardNetwork = async (params: { startTime: string; endTime: string }): Promise<any> => {
  const queryParams = `createTime[0]=${params.startTime}&createTime[1]=${params.endTime}`;
  return await request.get({ url: `/security/dashboard/network?${encodeURI(queryParams)}` })
}
// 数量
export  const getDashboardNetworkNumber = async (params: { startTime: string; endTime: string }): Promise<any> => {
  const queryParams = `createTime[0]=${params.startTime}&createTime[1]=${params.endTime}`;
  return await request.get({ url: `/security/dashboard/network-event-type?${encodeURI(queryParams)}` })
}
//应用协议分布
export  const getDashboardProtocolApp = async (params: { startTime: string; endTime: string }): Promise<any> => {
  const queryParams = `createTime[0]=${params.startTime}&createTime[1]=${params.endTime}`;
  return await request.get({ url: `/security/dashboard/protocol-app?${encodeURI(queryParams)}` })
}
// 协议类型分布
export  const getDashboardProtocolType = async (): Promise<any> => {
  return await request.get({ url: '/security/dashboard/protocol-type' })
}
// 协议分布趋势
export  const getDashboardProtocolBar = async (): Promise<any> => {
  return await request.get({ url: '/security/dashboard/protocol-bar' })
}
// 协议关键事情
export  const getDashboardNetworkEvent = async (): Promise<any> => {
  
  return await request.get({ url: '/security/dashboard/network-event' })
}
// 获取拓扑图图片
export  const getDashboardNetworkTopo = async (): Promise<any> => {
  return await request.fileStream({ url: '/security/dashboard/tuopu'})
}
